const systemInfo = uni.getSystemInfoSync();

console.log("systemInfo-------", systemInfo);

console.log("获取胶囊高度------", wx.getMenuButtonBoundingClientRect());

export function useSystemInfo() {
  const getSystemInfo = () => systemInfo;

  const getSafeBottom = () => systemInfo.safeAreaInsets?.bottom || 0;

  const getSafeTop = () => {
    const rect = wx.getMenuButtonBoundingClientRect();
    return rect.top || 0;
  };

  const getCapsuleBarHeight = () => {
    const rect = wx.getMenuButtonBoundingClientRect();
    return rect.height || 0;
  };

  return {
    getSystemInfo,
    getSafeBottom,
    getSafeTop,
    getCapsuleBarHeight,
  };
}
